package com.eclipse.e0112_io.随机访问文件;



import java.io.RandomAccessFile;

public class Test1 {

	public static void main(String[] args) throws Exception {
		RandomAccessFile raf = new RandomAccessFile("/Users/liuzhuangzhuang/Desktop/io/a.txt", "rw");

		raf.writeInt(20);

		raf.writeFloat(1.1f);

		raf.writeUTF("你好");
		
		raf.writeInt(21);

		raf.seek(0);//回到文件起点

		System.out.println(raf.readInt());

		System.out.println(raf.readFloat());

		raf.seek(0);

		raf.skipBytes(4);//跳过4个字节 int是4个字节

		System.out.println(raf.readFloat());
		
		System.out.println(raf.readShort());
		
		
		System.out.println(raf.readInt());//21

	}

}
